﻿


-- 监视点设备信息
CREATE procedure [dbo].[JsdsbInfo_Get]
@jsdbh varchar(18) = null,
@jsdsblsh int = null,
@sblsh int = null
as
select jsdsblsh,Jsdsb_Info.jsdbh,Sb_Info.sblsh,sfkqkq,sbbs,Jsdm,case sfkqkq when 0 then '关闭' else '开启' end sfkqkq_desc,
sfkqjs,case sfkqjs when 0 then '关闭' else '开启' end sfkqjs_desc
from Jsdsb_Info 
inner join Sb_Info on (Jsdsb_Info.sblsh=Sb_Info.sblsh)
inner join Jsd_Info on(Jsdsb_Info.jsdbh=Jsd_Info.jsdbh)
where (@jsdbh is null or Jsdsb_Info.jsdbh like @jsdbh+'%')
and (@jsdsblsh is null or jsdsblsh=@jsdsblsh)
and (@sblsh is null or Sb_Info.sblsh=@sblsh)